package io.ooad.jenkins.shuren;

import com.fasterxml.jackson.databind.JsonNode;
import retrofit2.Call;
import retrofit2.http.*;

/**
 * Created by yyang on 2016/12/30.
 */
public interface ShurenyunService {

    @POST("/v1/login")
    @Headers("Accept: application/json")
    Call<JsonNode> login(@Body JsonNode loginInfo);

    @POST("/v1/logout")
    @Headers("Accept: application/json")
    Call<JsonNode> logout();

    @GET("/v1/apps/{aid}")
    @Headers("Accept: application/json")
    Call<JsonNode> getAppById(@Path("aid") String aid);

    @POST("/v1/apps")
    @Headers("Accept: application/json")
    Call<JsonNode> createApp(@Body JsonNode appInfo);

    @PUT("/v1/apps/{aid}")
    @Headers("Accept: application/json")
    Call<JsonNode> updateApp(@Path("aid") String aid, @Body JsonNode appInfo);

    @DELETE("/v1/apps/{aid}")
    @Headers("Accept: application/json")
    Call<JsonNode> removeApp(@Path("aid") String aid);
}
